package com.ecoolex.ying.space.enums;

import com.ecoolex.framework.common.EnumInterface;
import com.ecoolex.framework.common.util.Check;

public enum GoodsAttachmentType implements EnumInterface<GoodsAttachmentType, Integer> {
    IMAGE(1, "商品图片"),
    MODEL(2,"商品模型"),
    VIDEO(3,"商品视频");

    private int real;

    private String describe;

    private GoodsAttachmentType(int real, String describe) {
        this.real = real;
        this.describe = describe;
    }

    @Override
    public Integer real() {
        return real;
    }

    @Override
    public String describe() {
        return describe;
    }

    @Override
    public GoodsAttachmentType realOf(Integer real) {
        if (Check.notNull(real)) {
            for (GoodsAttachmentType v : values()) {
                if (v.real().equals(real)) {
                    return v;
                }
            }
        }
        return null;
    }

    public static GoodsAttachmentType realValueOf(Integer real) {
        if (Check.notNull(real)) {
            for (GoodsAttachmentType v : values()) {
                if (v.real().equals(real)) {
                    return v;
                }
            }
        }
        return null;
    }
}
